package com.hujf.flink.DataStreamAPI;

import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author hujf
 * @Date 2022/3/17 15:54
 * @Description TODO
 */
public class Collection {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        DataStreamSource<String> stringDataStreamSource = env.fromElements("1", "2", "1", "2");

        stringDataStreamSource.print();

        List a = new ArrayList();
        a.add(1);
        a.add(2);
        a.add(3);
        DataStreamSource<String> stringDataStreamSource2 = env.fromCollection(a);
        stringDataStreamSource2.print();

        env.execute();

    }
}
